package com.xys.auth.mapper;

import com.xys.auth.bean.Product;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ProductMapper {

    @Select("select * from product")
    List<Product> findAll();

    @Insert("insert into product values(#{id},#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus})")
    int insert(Product product);

    @Select("select * from product where id =#{id}")
    Product findById(@Param("id") String id);

    @Delete("delete from product where id=#{id}")
    int delete(String id);
}
